import { BasicColumn } from '/@/components/Table/src/types/table';
import { FormProps } from '/@/components/Table';
import { useI18n } from '/@/hooks/web/useI18n';

const { t } = useI18n();

/**
 * 模块名:零件废止区
 * 代码描述:
 * 作者:张泽源
 * 创建时间:2025/05/20 09:31:29
 */
export function getAbolishColumns(): BasicColumn[] {
  return [
    {
      title: t('routes.table.PartAbolishList.PartCode'),
      dataIndex: 'thitObjectId',
      fixed: 'left',
      align: 'left',
      width: 300,
    },
    {
      title: t('routes.table.PartAbolishList.PartName'),
      dataIndex: 'name',
      width: 200,
      align: 'left',
    },
    {
      title: t('routes.table.PartAbolishList.PartType'),
      dataIndex: 'type',
      width: 200,
      align: 'left',
    },
    {
      title: t('routes.table.PartAbolishList.PartVersion'),
      dataIndex: 'version',
      width: 200,
      align: 'left',
    },
    {
      title: t('routes.table.PartAbolishList.PartIdentifier'),
      dataIndex: 'mark',
      width: 200,
      align: 'left',
      slots: { customRender: 'mark' },
    },
    {
      title: t('routes.table.PartAbolishList.PartCreator'),
      dataIndex: 'PartCreator',
      width: 200,
      align: 'left',
    },
    {
      title: t('routes.table.PartAbolishList.PartStatus'),
      dataIndex: 'status',
      width: 200,
      align: 'left',
      slots: { customRender: 'status' },
    },
    {
      title: t('routes.table.PartAbolishList.PartCustomAttributeSet'),
      dataIndex: 'allCustomProp',
      width: 200,
      align: 'left',
    },
    {
      title: t('routes.table.PartAbolishList.PartCheckoutPerson'),
      dataIndex: 'holder',
      width: 200,
      align: 'left',
    },
  ];
}

export function getAbolishConfig(): Partial<FormProps> {
  return {
    labelWidth: 100,
    colon: true, // 是否显示冒号
    schemas: [
      {
        field: `keyword`,
        label: t('routes.table.PartAbolishList.keyword'),
        component: 'Input',
        colProps: {
          xl: 12,
          xxl: 8,
        },
        componentProps: {
          placeholder: t('routes.table.PartAbolishList.keywordPlaceholder'),
        },
      },
    ],
  };
}
